<%@ page import="com.yusheng.entity.ApprovalRecordList" %>
<%@ page import="com.yusheng.entity.ApprovalRecord" %><%--
  Created by IntelliJ IDEA.
  User: Hello
  Date: 2021/6/8
  Time: 21:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html style="width: 100%">
<head >
    <title>Title</title>
</head>
<script>
   window.onload=function (){
       var content=document.getElementById("content");
       var s='${requestScope.approvalList}';
       // alert(s)
       window.eval("var approvalList="+s);

       var stuffName=approvalList.approvalRecordList[0].stuffName;
       var approvalName='';
       var recordNo='';
       var records=approvalList.approvalRecordList
       var htm='<div style="align-content: center;margin-left: 40%" >申请人：'+stuffName+' </div>';
       htm+='<canvas  name="canvas" width="50" height="50" style="margin-left: 45%"> </canvas><br>'

       for (var index in records ){
           stuffName=records[index].stuffName;
           approvalName=records[index].approvalName;

           if (records[index].currentRecord==approvalList.num){
               approvalName=records[index].approvalName;
               recordNo=records[index].recordNo;
               break;
           }
           htm+='<div style="align-content: center;margin-left: 40%" >审批人：'+approvalName+' &nbsp;&nbsp;&nbsp;已同意 </div>';
           htm+='<canvas  name="canvas" width="50" height="50" style="margin-left: 45%"></canvas><br>';
       }

       htm+='<div style="align-content: center;margin-left: 40%" >当前审批人：'+approvalName+'<br>意见：<textarea name="opionion"></textarea>  </div>';
       htm+='<input type="hidden" name="recordNo" value="'+recordNo+'">';
       htm+='<div style="align-content: center;margin-left: 40%" ><input type="radio" name="answer" value="no"> 驳回 <input type="radio" name="answer" value="agree"> 同意 <br><input type="submit" value="提交"> </div>';
      // alert(htm);
       content.innerHTML=htm;
       var c=document.getElementsByTagName("canvas");
       for(var s in c){
           var ctx=c[s].getContext("2d");
           ctx.strokeStyle="#33e3f0";
           ctx.moveTo(25,0);
           ctx.lineTo(25,50);

           ctx.moveTo(10,35);
           ctx.lineTo(25,50);
           ctx.moveTo(40,35);
           ctx.lineTo(25,50);
           ctx.stroke();
       }
   }
</script>
<body style="width: 100%">
<%--1.获取数据--%>
<%--2.遍历数据-----》生成流程（申请人，审批人：审批结果，当前审批人：审批意见--%>
<%--3.按钮提交结果--%>
    <div style=" height: 100%; width: 60%;margin-left: 20%;border-style: solid; border-width:1px;border-color: #849394">
        <form action="/approvalProcess/approval" id="content">


        </form>



</div>


</body>
</html>
